/*
 * @Description: 
 * @Version: 2.0
 * @Date: 2024-04-09 11:38:56
 * @LastEditTime: 2024-04-09 15:05:29
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
 // 配置文件引用别名 alias
 resolve: {
  alias: {
    "@": path.resolve(__dirname, "src"),
  },
  },
//  代理服务器配置
  server: {
    open: true, //自动打开浏览器
    hmr: true, //热更新，保存自动刷新
    host: "0.0.0.0",
    port: 9999,//运行端口
    proxy: {
      "/api": {
        target: "http://192.168.0.75:3000",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
})
